latextableII.m

Creates LaTeX tables of probit thresholds (Table II in Abbring and Campbell's ``Last-In First-Out Oligopoly Dynamics'').

At its conclusion, the string tablestra has the table of estimated thresholds, while tablestrb has the table of implied profits per consumer.

Contents

Acquire thresholds and transform them.

If probitThresholds or PiRatio do not exist, run experimentII.m to create them.

newrun=~(exist('probitThresholds','var') && exist('PiRatio','var'));
if newrun;
    newrunHOLD=1;
    experimentII;
end

Create the LaTeX table

The LaTeX table's first panel reports the estimated probit thresholds, and its second panel reports the implied ratios of producer's surplus per consumeer. We place these into separate tabular environments.

% Create strings with LaTeX tabular overhead
headerstr1 = ['\begin{tabular}{*{' num2str(size(probitThresholds,2)+1) '}{c}}'];
headerstrDoubleRule='\hline\hline\\';   %This is the double rule required by Econometrica.
headerstr2a = [' & \multicolumn{' num2str(size(probitThresholds,2)) '}{c}{Implied Static Entry Thresholds} \\'];
headerstr2b = [' & \multicolumn{' num2str(size(probitThresholds,2)) '}{c}{Implied $\pi(N)/\pi(1)$ for $N=$} \\'];
headerstr3a = ['$\sigma $' num2str(1:1:size(probitThresholds,2),' & $C^{\\star}_{%1.0f}$') ' \\ \hline'];
headerstr3b=  ['$\sigma $' num2str(1:1:size(probitThresholds,2),' & %1.0f') ' \\ \hline'];
closestr = '\end{tabular}';

% Contents
contentstra = ' ';
contentstrb = ' ';
for iter=1:nPoints;

    addThis= num2str(sigmaG(iter),'%2.2f ');
        for jiter=1:size(probitThresholds,2)
            if ~isnan(probitThresholds(iter,jiter))
                addThis = [addThis num2str(probitThresholds(iter,jiter),'& \\makebox[24pt]{%2.2f}')];
            else
                addThis = [addThis ' & \makebox[24pt]{ }'];
            end
        end
        addThis = [addThis '\\ '];
        contentstra = strvcat(contentstra,addThis);

    addThis = num2str(sigmaG(iter),'%2.2f ');
        for jiter=1:size(PiRatio,2)
            if ~isnan(PiRatio(iter,jiter))
                addThis = [addThis num2str(PiRatio(iter,jiter),'& \\makebox[24pt]{%2.2f}')];
            else
                addThis = [addThis ' & \makebox[24pt]{ }'];
            end
        end
        addThis = [addThis '\\ '];
        contentstrb = strvcat(contentstrb,addThis);

end

Assemble the final output.

tablestra=strvcat(headerstr1,headerstrDoubleRule,headerstr2a,headerstr3a,contentstra,closestr);
tablestrb=strvcat(headerstr1,headerstr2b,headerstr3b,contentstrb,closestr);

Display output if this is a test run.

if exist('newrunHOLD','var')
    disp(probitThresholds);
    disp(tablestra);
    disp(PiRatio);
    disp(tablestrb);
    clear newrunHOLD
end
    0.4328    0.9155    1.3379    1.9193    2.3425    2.8903    3.1895    3.9330
    0.4274    0.8693    1.3198    1.7823    2.2387    2.6993    3.1333       NaN
    0.3929    0.8331    1.2857    1.7454    2.1964    2.6208       NaN       NaN
    0.3421    0.8080    1.2578    1.6986    2.0542       NaN       NaN       NaN

\begin{tabular}{*{9}{c}}                                                                                                                                                               
\hline\hline\\                                                                                                                                                                         
 & \multicolumn{8}{c}{Implied Static Entry Thresholds} \\                                                                                                                              
$\sigma $& $C^{\star}_{1}$ & $C^{\star}_{2}$ & $C^{\star}_{3}$ & $C^{\star}_{4}$ & $C^{\star}_{5}$ & $C^{\star}_{6}$ & $C^{\star}_{7}$ & $C^{\star}_{8}$ \\ \hline                     
                                                                                                                                                                                       
0.00& \makebox[24pt]{0.43}& \makebox[24pt]{0.92}& \makebox[24pt]{1.34}& \makebox[24pt]{1.92}& \makebox[24pt]{2.34}& \makebox[24pt]{2.89}& \makebox[24pt]{3.19}& \makebox[24pt]{3.93}\\ 
0.05& \makebox[24pt]{0.43}& \makebox[24pt]{0.87}& \makebox[24pt]{1.32}& \makebox[24pt]{1.78}& \makebox[24pt]{2.24}& \makebox[24pt]{2.70}& \makebox[24pt]{3.13} & \makebox[24pt]{ }\\   
0.10& \makebox[24pt]{0.39}& \makebox[24pt]{0.83}& \makebox[24pt]{1.29}& \makebox[24pt]{1.75}& \makebox[24pt]{2.20}& \makebox[24pt]{2.62} & \makebox[24pt]{ } & \makebox[24pt]{ }\\     
0.15& \makebox[24pt]{0.34}& \makebox[24pt]{0.81}& \makebox[24pt]{1.26}& \makebox[24pt]{1.70}& \makebox[24pt]{2.05} & \makebox[24pt]{ } & \makebox[24pt]{ } & \makebox[24pt]{ }\\       
\end{tabular}                                                                                                                                                                          
    1.0000    0.9455    0.9705    0.9020    0.9238    0.8985    0.9499    0.8804
    1.0000    0.9834    0.9715    0.9592    0.9546    0.9501    0.9549       NaN
    1.0000    0.9433    0.9168    0.9005    0.8945    0.8996       NaN       NaN
    1.0000    0.8469    0.8160    0.8057    0.8328       NaN       NaN       NaN

\begin{tabular}{*{9}{c}}                                                                                                                                                               
 & \multicolumn{8}{c}{Implied $\pi(N)/\pi(1)$ for $N=$} \\                                                                                                                             
$\sigma $& 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \hline                                                                                                                                     
                                                                                                                                                                                       
0.00& \makebox[24pt]{1.00}& \makebox[24pt]{0.95}& \makebox[24pt]{0.97}& \makebox[24pt]{0.90}& \makebox[24pt]{0.92}& \makebox[24pt]{0.90}& \makebox[24pt]{0.95}& \makebox[24pt]{0.88}\\ 
0.05& \makebox[24pt]{1.00}& \makebox[24pt]{0.98}& \makebox[24pt]{0.97}& \makebox[24pt]{0.96}& \makebox[24pt]{0.95}& \makebox[24pt]{0.95}& \makebox[24pt]{0.95} & \makebox[24pt]{ }\\   
0.10& \makebox[24pt]{1.00}& \makebox[24pt]{0.94}& \makebox[24pt]{0.92}& \makebox[24pt]{0.90}& \makebox[24pt]{0.89}& \makebox[24pt]{0.90} & \makebox[24pt]{ } & \makebox[24pt]{ }\\     
0.15& \makebox[24pt]{1.00}& \makebox[24pt]{0.85}& \makebox[24pt]{0.82}& \makebox[24pt]{0.81}& \makebox[24pt]{0.83} & \makebox[24pt]{ } & \makebox[24pt]{ } & \makebox[24pt]{ }\\       
\end{tabular}                                                                                                                                                                          
Experiment took 80.09 seconds